<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>美嘉饲料</title>
<link href="<%=basePath%>skin/css/public.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath%>skin/css/order.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=basePath%>skin/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/common.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/sdmenu.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/select-widget-min.js"></script>	
<script type="text/javascript" src="<%=basePath%>skin/js/public.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	navi();
	
	var $linetips = $("#linetips"); 
	var orderStatus = "${paramBean.orderStatus}";
	if(orderStatus == 1) {
		$linetips.attr("style", "left: 100px;");
	} else if(orderStatus == 2) {
		$linetips.attr("style", "left: 200px;");
	} else if(orderStatus == 3) {
		$linetips.attr("style", "left: 300px;");
	} else {
		$linetips.attr("style", "left: -10px;");
	}
}); 
var myMenu;
window.onload = function() {
	myMenu = new SDMenu("my_menu");
	myMenu.init();
};
</script>
</head>
<body>
	<div class="order">	
    	<div class="container">
        	<div class="header-wrap">
            	<c:import url="/layouts/top.jsp" />
                <c:import url="/layouts/head.jsp" />
                <div class="nav-warp">
					<div class="nav-main-warp wp">
						<div class="head-v3">
							<div class="navigation-up">
								<div class="navigation-inner">
									<div class="navigation-v3">
										<ul>
											<li class="fLeft navi_product first" _t_nav="product">
												<h2>
													<a href="<%=basePath%>shop/product/list.shtml">全部产品
														<img src="<%=basePath%>skin/images/all-product-arrow.png" />
													</a>
												</h2>
											</li>
											<li class="nav-up-selected-inpage fLeft" _t_nav="home">
												<h2>
													<a href="<%=basePath%>">美嘉商城</a>
												</h2>
											</li>
											<li class="fLeft self_community" _t_nav="community">
												<h2>
													<a href="javascript:void(0)">美嘉社区</a>
												</h2>
											</li>
											<li class="fLeft technology" _t_nav="technology">
												<h2>
													<a href="#">饲养技术</a>
												</h2>
											</li>
											<li class="fLeft server" _t_nav="server">
												<h2>
													<a href="">美嘉服务</a>
												</h2>
											</li>
											<li class="fLeft know" _t_nav="know">
												<h2>
													<a href="aboutMJ.html">了解美嘉</a>
												</h2>
											</li>
											<li class="fLeft navi_cart" _t_nav="cart">
												<h2>
													<a href="<%=basePath%>cart/list.shtml">
														<img src="<%=basePath%>skin/images/cart-icon.png" />购物车（<span id="cartnum">0</span>）
													</a>
												</h2>
											</li>
										</ul>
									</div>
								</div>
							</div>
							<div class="navigation-down">
								<div id="product" class="nav-down-menu menu-1"
									style="display: none;" _t_nav="product">
									<div class="navigation-down-inner">
										<c:forEach items="${productCategoryTree }" var="productCategory">
											<c:if test="${productCategory.grade == 0 }">
												<div class="navi-down-area">
													<a href="<%=basePath%>shop/product/list.shtml?productCategoryId=${productCategory.id }" class="product-cate">
														<img src="<%=basePath%>download.shtml?filepath=${productCategory.source}" />
													</a>
													<ul>
														<li><a href="<%=basePath%>shop/product/list.shtml?productCategoryId=${productCategory.id }">${productCategory.name}</a></li>
														<div class="clear"></div>
													</ul>
												</div>
											</c:if>
										</c:forEach>
									</div>
								</div>
								
								<div id="community" class="nav-down-menu menu-3" style="display: none;" _t_nav="community">
                                    <div class="navigation-down-inner">
                                    	<div class="navi-down-area-second">
                                        	<a href="<%=basePath%>forumTopic/list.shtml" class="product-cate"><img src="<%=basePath%>skin/images/mjbbs.png" /></a>
                                        </div>
                                        <div class="navi-down-area-second">
                                        	<a href="<%=basePath%>collegeTopic/list.shtml" class="product-cate"><img src="<%=basePath%>skin/images/mjschool.png" /></a>
                                        </div>
                                    </div>
                                </div>
							</div>
						</div>
					</div>
				</div>
            </div>
        	<div class="content">
        	<div class="link_navi"><a href="<%=basePath%>">主页</a> > <a href="<%=basePath%>member/index.shtml">用户中心</a> > <a href="<%=basePath%>member/order/list.shtml">已买到的商品</a></div>
                <div class="order-content clearfix">
                	<c:import url="../left.jsp" />
                    <div class="col-main">
                        <div class="main-wrap">
							<div class="main-wrap">
                                <div id="main-content">
                                    <div class="trade-remind">
                                        <ul class="list">
                                            <li class="selected first">
                                                <a class="link" href="<%=basePath%>member/order/list.shtml">
                                                    <span>所有订单</span>
                                                    <i class="interval">|</i>
                                                </a>
                                            </li>
                                            <li>
                                                <a class="link" href="<%=basePath%>member/order/list.shtml?orderStatus=1">
                                                    <span>待付款</span>
                                                    <em class="tm-h">${notPayCount }</em>
                                                    <i class="interval">|</i>
                                                </a>
                                            </li>
                                            <li>
                                                <a class="link" href="<%=basePath%>member/order/list.shtml?orderStatus=2">
                                                    <span>待发货</span>
                                                    <em class="tm-h">${notShipCount }</em>
                                                    <i class="interval">|</i>
                                                </a>
                                            </li>
                                            <li>
                                                <a class="link" href="<%=basePath%>member/order/list.shtml?orderStatus=3">
                                                    <span>待收货</span>
                                                    <em class="tm-h">${notReceiveCount }</em>
                                                    <i class="interval">|</i>
                                                </a>
                                            </li>
                                        </ul>
                                        <div class="wrap-line">
                                            <span id="linetips" class="line selected0" style="left: 0px;"></span>
                                        </div>
                                    </div>
                                    <div class="searchbar">
                                    	<form action="<%=basePath%>member/order/list.shtml" id="form1" name="form1" method="get">
	                                        <div class="simple">
	                                            <input name="keyword" type="text" id="keyword" class="auction-title" type="text" placeholder="输入订单号进行搜索" size="50">
	                                            <span class="search-btn">
	                                                <button class="J_MakePoint button" type="submit">搜索</button>
	                                            </span>
	                                        </div>
                                        </form>
                                    </div>
                                    <div class="bought-list">
                                        <table class="bought-table">
                                            <colgroup>
                                                <col class="baobei">
                                                <col class="price">
                                                <col class="quantity">
                                                <col class="amount">
                                                <col class="trade-status">
                                                <col class="trade-operate">
                                            </colgroup>
                                            <thead>
                                                <tr class="col-name">
                                                    <th class="baobei">商品</th>
                                                    <th class="price">单价(元)</th>
                                                    <th class="quantity">数量</th>
                                                    <th class="amount">实付款(元)</th>
                                                    <th class="trade-status">
                                                    	状态
                                                    </th>
                                                    <th class="trade-operate">操作</th>
                                                </tr>
                                            </thead>
                                            <c:choose>
											<c:when test="${empty pagination || empty pagination.recordList || pagination.recordCount < 1}"></c:when>
											<c:otherwise>
											<c:forEach items="${pagination.recordList }" var="order">
                                            <tbody>
                                                <tr class="order-hd">
                                                    <td class="first" colspan="4">
                                                        <div class="summary">
                                                            <span class="dealtime"><fmt:formatDate value="${order.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></span>
                                                            <span class="number last-item">
                                                                                                                                                                      订单号：
                                                                <em>${order.sn }</em>
                                                            </span>
                                                        </div>
                                                    </td>
                                                    <td class="last" colspan="3">
                                                    </td>
                                                </tr>
                                                <c:forEach items="${order.orderItems }" var="orderItem">
                                                <tr class="order-bd last order-last">
                                                    <td class="baobei">
                                                        <a class="pic" href="<%=basePath%>shop/product/detail.shtml?productId=${orderItem.product.id}" target="_blank">
                                                        	<img class="itemInfo-pic" width="220" height="220" title="${orderItem.product.name}" src="<%=basePath%>download.shtml?filepath=${orderItem.product.thumbnail} "/>
                                                        </a>
                                                        <div class="desc">
                                                        <p class="baobei-name">
                                                        <a  href="<%=basePath%>shop/product/detail.shtml?productId=${orderItem.product.id}" target="_blank" > 
                                                        	${orderItem.product.name}
                                                        </a>
                                                        </p>
                                                        <div class="spec" title="">
                                                            ${order.memo}
                                                        </div>
                                                        <span class="good-icons">
                                                        </span>
                                                        </div>
                                                    </td>
                                                    <td class="price" >
                                                        <i class="special-num"><fmt:formatNumber value="${orderItem.product.price}" pattern="0.00"/></i>
                                                    </td>
                                                    <td class="quantity">
                                                        <i class="special-num">${orderItem.quantity}</i>
                                                    </td>
                                                    <td class="amount" rowspan="1">
                                                        <p>
                                                        <em class="real-price special-num"><fmt:formatNumber value="${orderItem.product.price*orderItem.quantity}" pattern="0.00"/></em>
                                                        </p>
                                                        <p class="post-type"> </p>
                                                    </td>
                                                    <td class="trade-status" rowspan="1">
                                                        ${order.orderStatusLabel }
                                                    </td>
                                                    <td class="trade-operate" rowspan=" 1 ">
                                                        <span>
                                                            <a class="detail-link" target="_blank" href="orderDetail.html"> 订单详情 </a>
                                                        </span>
                                                    </td>
                                                </tr>
                                                </c:forEach>
                                            </tbody>
                                            </c:forEach>
											</c:otherwise>
											</c:choose>
                                            <tfoot>
                                            <tr class="sep-row">
                                                <td colspan="7"></td>
                                            </tr>
                                            <tr class="toolbar toolbar-bottom">
                                                <td colspan="7">
                                                <div class="paging-box paging-full">
                                                	${pagination.pageHtml }
                                                </div>
                                                </td>
                                            </tr>
                                            </tfoot>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div> 
			</div>
			<c:import url="/layouts/foot2.jsp" />
        </div>
    </div>
</body>
</html>
